  {% include "header.html" %}
  <script type="text/javascript" >
    var agency_id = "{{ agency_id }}";
    var route_type = "{{ route_type }}";
  </script>
  <h1>Transfer List <a href="http://code.google.com/transit/spec/transit_feed_specification.html#routes_txt___Field_Definitions">Refer</a></h1>
  {% if prompt %}
  <p id="prompt">{{ prompt }}</p>
  {% endif %}
  <div id="editor">
    <form method="POST" action="{{ url }}" id="editorform">
      <table>
        <tr>
          <th>Items</th>
          <th>Values</th>
        </tr>
        <tr>
          <td>From Stop ID</td>
          <td>
          <select name = "from_stop_id" id = "from_stop_id">
          {% for stop in stops %}
          {% if stop.id == transfer.from_stop_id %}
          <option value="{{stop.id}}" selected>{{stop.name}}</option>
          {% else %}          
          <option value="{{stop.id}}">{{stop.name}}</option>
          {% endif %}
          {% endfor %}
          </select>
          </td>
        </tr>
        <tr>
          <td>To Stop ID</td>
          <td>
          <select name = "to_stop_id" id = "to_stop_id">
          {% for stop in stops %}
          {% if stop.id == transfer.to_stop_id %}
          <option value="{{stop.id}}" selected>{{stop.name}}</option>
          {% else %}          
          <option value="{{stop.id}}">{{stop.name}}</option>
          {% endif %}
          {% endfor %}
          </select>      
          </td>
        </tr>
        <tr>
          <td>Transfer Type</td>
          <td>
          <select name = "transfer_type" id = "transfer_type">
          {% if transfer.transfer_type == 0 or transfer.transfer_type == "" %}
          <option value="0" selected>Recommended Transfer</option>
          {% else %}
          <option value="0" selected>Recommended Transfer</option>
          {% endif %}
          {% if transfer.transfer_type == 1 %}
          <option value="1" selected>Short Timed Transfer</option>
          {% else %}
          <option value="1" >Short Timed Transfer</option>
           {% endif %}
           {% if transfer.transfer_type == 2 %}
          <option value="2" selected >Long Timed Transfer(Require Minimum Transfer Time)</option>
          {% else %}
          <option value="2" >Long Timed Transfer(Require Minimum Transfer Time)</option>
           {% endif %}
           {% if transfer.transfer_type == 3 %}
          <option value="3" selected>Recommended Transfer</option>
          {% else %}
          <option value="3" >Recommended Transfer</option>
           {% endif %}
          </select>
          </td>
        </tr>
        <tr>
          <td>Minimum Transfer Time</td>
          <td>
          <input name="min_transfer_time" id = "min_transfer_time" value="{{transfer.min_transfer_time}}"/>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <input type="submit" id = "submit" value="{{ submit }}" name = "submit" />
          </td>
        </tr>
      </table>
  </form>


</div>
<div class="sort">
  <form method="POST" action="" name="search">
    <input type="text" value=""/> <input type="submit" value="Search"/>
  </form>


</div>
    <div class="pager">
      paging info: [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <table>
      <tr>
    <th>&nbsp;</th>
    <th>From Stop ID</th>
    <th>To Stop ID</th>
    <th>Transfer Type</th>
    <th>Minimum Transfer Time</th>
    <th>Action</th>
      </tr>
      {% for transfer in transfers %}
      <tr>
        <td><input type="checkbox" name="deleteid" value="{{transfer.from_stop_id}}"/></td>
        <td>{{transfer.from_stop_id}}</td>
        <td>{{transfer.to_stop_id}}</td>
        <td>{{transfer.transfer_type}}</td>
        <td>{{transfer.min_transfer_time}}</td>
        <td>
          <a href="/admin/transfer?act=edit&fid={{transfer.from_stop_id}}&tid={{transfer.to_stop_id}}">Edit</a>&nbsp;
          <a href="/admin/transfer?act=delete&fid={{transfer.from_stop_id}}&tid={{transfer.to_stop_id}}">Delete</a>
        </td>
      </tr>
      {% endfor %}
    </table>
    <div class="pager">
      [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <div class="control">
      <input type="submit" value="Delete All"/>
    </div>
  </body>
</html>
